<template>
    <view>
        <!-- 已处理显示 -->
        <view v-show="array.handle_status_name ==='已处理'">
            <view class="disposrHead">
                <view class="disposrHead-first">
                    <text class="disposrHead-first-disposr">{{array.handle_status_name}}</text>
                    <text class="disposrHead-first-time">{{array.handle_time}}</text>
                </view>
                <view class="disposrHead-second">{{array.equipment_name}}</view>
                <view style="margin-top:20rpx;">
                    <text style="font-size:34rpx;">处理简报:</text>
                    <text class="disposrHead-first-time">{{array.sketch}}</text>
                </view>
                <view class="disposrHead-disposeMan">执行人:{{array.handle_user_name}}</view>
            </view>
            <view class="content">
                <view>
                    <view class="contentItem">
                        <text>报警名称</text>
                        <text>{{array.trigger_name}}</text>
                    </view>
                    <view class="contentItem">
                        <text>所属公司</text>
                        <text>{{array.company_name}}</text>
                    </view>
                    <view class="contentItem">
                        <text>设备名称</text>
                        <text>{{array.equipment_name}}</text>
                    </view>
                    <view class="contentItem">
                        <text>数据名称</text>
                        <text>{{array.register_name}}</text>
                    </view>
                    <view class="contentItem">
                        <text>触发条件</text>
                        <text>{{array.condition_name}}</text>
                    </view>
                    <view class="contentItem">
                        <text>报警时间</text>
                        <text class="contentItem-time">{{array.alarm_time}}</text>
                    </view>
                    <view class="contentItem">
                        <text>报警方式</text>
                        <text class="contentItem-time">{{array.type_name}}</text>
                    </view>
                    <view class="contentItem">
                        <text>报警联系人</text>
                        <text class="contentItem-time">{{array.full_name}}</text>
                    </view>
                    <!-- <view class="contentItem-content"> -->
                        <!-- <text>推送内容</text> -->
                        <!-- <view>{{array.content}}</view> -->
                        <!-- <view class="contentItem-content-buttom"> -->
                            <!-- <button class="mini-btn" type="primary" size="mini" @tap="bingDispose">处理</button> -->
                            <!-- <button class="mini-btn" type="primary" size="mini" @tap="bingMisinformation">误报</button> -->
                        <!-- </view> -->
                    </view>
                </view>
            </view>
        </view>

        <!-- 未处理显示 -->
        <!-- <view v-show="array.handle_status_name ==='未处理'">
            <view class="disposrHead">
                <view class="disposrHead-first">
                    <text class="disposrHead-first-disposr">{{array.disposeIn}}</text>
                    <text class="disposrHead-first-time">{{array.disposeTime}}</text>
                </view>
                <view class="disposrHead-second">{{array.disposeContent}}</view>
                <view class="disposrHead-disposeMan">执行人:{{array.disposeMan}}</view>
            </view>
            <view class="content">
                <view>
                    <view class="contentItem">
                        <text class="text2">报警名称</text>
                        <text>{{array.name}}</text>
                    </view>
                    <view class="contentItem">
                        <text>所属单位</text>
                        <text>{{array.unit}}</text>
                    </view>
                    <view class="contentItem">
                        <text>设备单位</text>
                        <text>{{array.equipment}}</text>
                    </view>
                    <view class="contentItem">
                        <text>数据名称</text>
                        <text>{{array.data}}</text>
                    </view>
                    <view class="contentItem">
                        <text>触发条件</text>
                        <text>{{array.condition}}</text>
                    </view>
                    <view class="contentItem">
                        <text>报警时间</text>
                        <text class="contentItem-time">{{array.time}}</text>
                    </view>
                    <view class="contentItem">
                        <text>报警方式</text>
                        <text class="contentItem-time">{{array.way}}</text>
                    </view>
                    <view class="contentItem">
                        <text>报警联系人</text>
                        <text class="contentItem-time">{{array.linkman}}</text>
                    </view>
                    <view class="contentItem-content">
                        <text>推送内容</text>
                        <view>{{array.content}}</view>
                        <view class="contentItem-content-buttom">
                    <button class="mini-btn" type="primary" size="mini" @tap="bingDispose">处理</button>
                    <button class="mini-btn" type="primary" size="mini" @tap="bingMisinformation">误报</button>
                </view>
                    </view>
                </view>
            </view>
        </view> -->
    </view>
</template>

<script>
import {
    request
} from "../../../comon/js/request.js"
export default {
    data() {
        return {
            id: "",
            array: {
                dispose: "已处理",
                disposeIn: "误报",
                disposeTime: "2018年09月18日 08:35",
                disposeContent: "到现场排查到现场排查到现场排查到现场排查排查到现场排查到现场排查到现场排查到现场排查排查..",
                disposeMan: "某某某",
                name: "温度监控",
                unit: "上海真宏公司",
                equipment: "上海真宏",
                data: "急停状态",
                condition: "关",
                time: "2018年09月18日 08:35",
                way: "短信/邮件",
                linkman: "XXX/XXX/XXX",
                content: "到现场排查到现场排查到现场排查到现场排查排查到现场排查到现场排查到现场排查到现场排查排查.."
            }
        }
    },

    methods: {
        // 获取报警记录
        getId() {
            request({
                url: `v1/alarmRecord/detail/${this.id}`,
                method: "GET",
            }).then(res => {
                console.log(res, "输出了嘛")
                this.array = res.data.result
            })
        },

        bingDispose() {
            // uni.navigateTo({
            //     url: "../dispose/dispose"
            // })
        },

        // bingMisinformation() {
        //     uni.showModal({
        //         content: "已巡查,确认误报!",
        //         showCancel:false,
        //         success: function (res) {
        //             if (res.confirm) {
        //                 console.log("用户点击确定");
        //             }
        //         }
        //     });
        // }
    },
    onLoad(options) {
        this.id = options.id
        console.log(this.id)
        this.getId()
        // this.getDispose()
    }
}
</script>

<style lang="less">
.disposrHead {
    width: 686rpx;
    height: 250rpx;
    background: #e8f0f4;
    margin: 0 auto;
    padding: 12rpx;
    // border: 1rpx solid pink;

    .disposrHead-first {
        display: flex;
        justify-content: space-between;

        .disposrHead-first-disposr {
            margin-top: 20rpx;
            font-weight: 500;
            font-size: 36rpx;
            color: #222222;
            letter-spacing: 0;
            line-height: 18rpx;
        }

        .disposrHead-first-time {
            font-size: 24rpx;
            color: #666666;
            margin-top: 20rpx;
            padding-right: 30rpx;
        }
    }

    .disposrHead-second {
        margin-top: 24rpx;
        font-size: 26rpx;
        color: #353535;
        letter-spacing: 0.4rpx;
        line-height: 44rpx;
    }

    .disposrHead-disposeMan {
        // margin-left: 530rpx;
        margin-top: 30rpx;
        // font-size: 28rpx;

        font-size: 24rpx;
        color: #222222;
        letter-spacing: 0;
        text-align: right;
        line-height: 36rpx;
    }
}

.content {
    width: 686rpx;
    margin: 0 auto;

    .contentItem {
        height: 60rpx;
        display: flex;
        justify-content: space-between;
        border-bottom: 1rpx solid #f4f4f4;
        margin-top: 30rpx;
        // margin: 0 auto;
        padding-bottom: 10rpx;
        font-size: 22rpx;
        color: #656565;
        line-height: 60rpx;

        >text {
            font-size: 26rpx;
        }

        .contentItem-time {
            font-size: 24rpx;
            color: #666666;
            padding-top: 8rpx;
        }
    }

    .contentItem-content {
        font-size: 28rpx;
        margin-top: 30rpx;
        padding-bottom: 10rpx;

        view {
            margin-top: 20rpx;
        }

        .contentItem-content-buttom {
            margin-top: 200rpx;
            display: flex;
            justify-content: space-between;

            .mini-btn {
                width: 250rpx;
                height: 80rpx;
                line-height: 80rpx;
                background: #169bd5;

            }
        }

    }
}
</style>
